home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / share / edje / data / src / test.edc < prev   
Text File  |  2006-01-09  |  7KB  |  321 lines

  1. // Fonts to be inlined and used that a user might not have already installed
  2. fonts
  3. {
  4.    // The first argument is the file, just like images, the second is the
  5.    // font name this font is to be known as by edje text objects as the
  6.    // font name
  7.    font: "Vera.ttf" "Edje.Font.Name";
  8. }
  9.  
  10. // Images in the image database for the output file
  11. images
  12. {
  13.    // image "filename.png" STORAGE_MEOTHD [option to storage method];
  14.    // STORAGE_METHOD can be:
  15.    // COMP = compressed, no loss
  16.    // RAW = uncompressed, no loss
  17.    // LOSSY = compressed with quality loss, next param is quality level (0-100)
  18.    image: "bg.png"        LOSSY 80; /* raw pixels */
  19.    image: "e.png"         COMP; /* compressed */
  20. }
  21.  
  22. // data can be attached to the edje file as a whole. string key, value style
  23. data
  24. {
  25.    item: "Key" "This is a"" continued string";
  26.    item: "My Data" "The string to attach to this data";
  27.    item: "The Key" "String data attached to the key";
  28. }
  29.  
  30. collections
  31. {
  32.    group
  33.      {
  34.     name: "test";
  35. //    min: 0 0;
  36. //    max: 0 0;
  37. // more data that can be attached per collection
  38.     data
  39.       {
  40.          item: "My Data" "The string to attach to this data";
  41.          item: "The Key" "String data attached to the key";
  42.       }
  43. // this section is optional. it contains all "shared" subroutines for this
  44. // group. so if any program scripts call functions that are not edje
  45. // exported calls, then this is where you put your own subroutines.
  46.     script
  47.       {
  48.          my_routine(var)
  49.            {
  50.           new i;
  51.           
  52.           if (var > 10) tst();
  53.           if (var > 20)
  54.             {
  55.                for (i = 20; i < var; i++)
  56.              emit("SMELLY", "Fish");
  57.             }
  58.            }
  59.          
  60.          tst()
  61.            {
  62.           return 0;
  63.            }
  64.  
  65. // a special function for handling app messages - put it here if you want to
  66. // handle messages from apps
  67.          public message(Msg_Type:type, id, ...)
  68.            {
  69.           emit("MSG", "PROCESS");
  70.           if (type == MSG_NONE)
  71.             {
  72.                new buf[100];
  73.                
  74.                snprintf(buf, sizeof(buf), "ID: %i", id);
  75.                emit("MESSAGE_NONE", buf);
  76.             }
  77.           else if (type == MSG_STRING)
  78.             {
  79.                new str[100];
  80.                new buf[100];
  81.                
  82.                snprintf(buf, sizeof(buf), "MESSAGE STRING ID: %i", id);
  83.                getsarg(2, str, 100);
  84.                emit(buf, str);
  85.             }
  86.           else if (type == MSG_INT_SET)
  87.             {
  88.                new buf[100];
  89.                
  90.                snprintf(buf, sizeof(buf), "MESSAGE INT SET ID: %i", id);
  91.                for (new i = 2; i < numargs(); i++)
  92.              {
  93.                 new val;
  94.                 new str[100];
  95.                 
  96.                 val = getarg(i);
  97.                 snprintf(str, sizeof(str), "V %i", val);
  98.                 emit(buf, str);
  99.              }
  100.             }
  101.            }
  102.       }
  103.     parts
  104.       {
  105.          part
  106.            {
  107.           name:          "background";
  108. // IMAGE, RECT, TEXT, SWALLOW
  109. //          type:          IMAGE;
  110. // for text only really 
  111. // NONE, PLAIN, OUTLINE, SOFT_OUTLINE, SHADOW, SOFT_SHADOW, OUTLINE_SHADOW,
  112. // OUTLINE_SOFT_SHADOW
  113. //          effect:        NONE;
  114.           mouse_events:  0;
  115. //          repeat_events: 0;
  116. //                clip_to:       "p1";          
  117. //          color_class:   "default";
  118. //          text_class:    "default";
  119. //          dragable
  120. //            {
  121. // direction, on/off stepping count
  122. //               x: 0 1 2;
  123. //               y: 0 1 2;
  124. //               confine: "p2";
  125. //            }
  126.           description
  127.             {
  128. // state, "name" (float value 0.0 - 1.0)
  129.                state:    "default" 0.0;
  130.                visible:  1;
  131. //               align: 0.5 0.5;
  132. //               min: 0 0;
  133. //               max: 0 0;
  134. //               step: 1 1;
  135. //               aspect: 0.0 999999.0;
  136. // can be NONE VERTICAL HORIZONTAL and BOTH - depending which axis (if any)
  137. // is used as a master control on aspect calculations
  138. //                     aspect_preference: NONE;
  139.                rel1
  140.              {
  141.                 relative: 0.0  0.0;
  142.                 offset:   0    0;
  143. // if not defined assumed to be -1 (relative to all). to alone implies x & y
  144. //                to:       "p2";
  145. // relative to thia named part only in X direction
  146. //                to_x:       "p2";
  147. // and relative to this part only in the y direction
  148. //                to_y:       "p2";
  149.              }
  150.                rel2
  151.              {
  152.                 relative: 1.0  1.0;
  153.                 offset:   -1   -1;
  154.              }
  155.                image
  156.              {
  157.                 normal: "bg.png";
  158. // tween images are images that are looped thru when graduating TO normal
  159. //                tween: "test2.png";
  160. //                tween: "test3.png";
  161.              }
  162.                border: 12 12 12 12;
  163. //               fill
  164. //             {
  165. //                smooth: 1;
  166. //                origin
  167. //                  {
  168. //                 relative: 0.0 0.0;
  169. //                 offset:   0   0;
  170. //                  }
  171. //                size
  172. //                  {
  173. //                 relative:   1.0 1.0;
  174. //                 offset:     0   0;
  175. //                  }
  176. //             }
  177. // only useful if its a rect or text object               
  178. //               color:  255 255 255 255;
  179. // only useful if its a text object           
  180. //               color2: 255 255 255 255;
  181. //               color3: 255 255 255 255;
  182. //               text
  183. //             {
  184. //                text:   "test text";
  185. //                font:   "Vera";
  186. //                size:   12;
  187. //                fit:    0 0;
  188. //                min:    1 1;
  189. //                align:  0.5 0.5;
  190. //                          alipsis: 0.0;
  191. //             }
  192.             }
  193.            }
  194.          part
  195.            {
  196.           name:          "logo";
  197.           description
  198.             {
  199.                state:    "default" 0.0;
  200.                visible:  1;
  201.                max: 64 64;
  202.                rel1
  203.              {
  204.                 relative: 0.0  0.0;
  205.                 offset:   16   16;
  206.              }
  207.                rel2
  208.              {
  209.                 relative: 1.0  1.0;
  210.                 offset:   -17  -17;
  211.              }
  212.                image
  213.              {
  214.                 normal: "e.png";
  215.              }
  216.             }
  217.           description
  218.             {
  219.                state:    "clicked" 0.0;
  220.                visible:  1;
  221.                align:    0.5 0.5;
  222.                max:      64 64;
  223.                rel1
  224.              {
  225.                 relative: 0.0  0.0;
  226.                 offset:   16   16;
  227.              }
  228.                rel2
  229.              {
  230.                 relative: 1.0  1.0;
  231.                 offset:   -17  -17;
  232.              }
  233.                image
  234.              {
  235.                 normal: "e.png";
  236.              }
  237.             }
  238.            }
  239.       }
  240.     programs
  241.       {
  242.          program
  243.            {
  244.           name:       "logo_click";
  245.           signal:     "mouse,down,1";
  246.           source:     "logo";
  247. // STATE_SET, ACTION_STOP, SIGNAL_EMIT, DRAG_VAL_SET, DRAG_VAL_STEP, DRAG_VAL_PAGE
  248.           action:     STATE_SET "clicked" 0.0;
  249. // LINEAR, SINUSOIDAL, ACCELERATE, DECELERATE, + seconds to transition over
  250. //          transition: LINEAR 0.0;
  251. // who to apply this state to, can be multiple targets
  252.           target:     "logo";
  253. //          after:      "p1_fade_1";
  254.            }
  255.          program
  256.            {
  257.           name:       "logo_unclick";
  258.           signal:     "mouse,up,1";
  259.           source:     "logo";
  260.           action:     STATE_SET "default" 0.0;
  261.           target:     "logo";
  262.            }
  263.          program
  264.            {
  265.           name:       "logo_unclick_script";
  266.           signal:     "mouse,up,1";
  267.           source:     "logo";
  268. // code to execute if this program matches. it can use subroutines declared
  269. // for this group or functions exported
  270.           script
  271.             {
  272.                new i = 5;
  273.                
  274.                while (i > 0)
  275.              {
  276.                 my_routine(10 + (i * 5));
  277.                 i--;
  278.              }
  279.             }
  280.            }
  281. /*         
  282.          program
  283.            {
  284.           name:       "p1_fade_2";
  285.           signal:     "action,end";
  286.           source:     "p1_fade_1";
  287.           action:     STATE_SET "clicked" 0.0;
  288.           transition: LINEAR 1.0;
  289.           target:     "p1";
  290.           after:      "p1_fade_1";
  291.            }
  292.          program
  293.            {
  294.           name:       "p1_unclicked";
  295.           signal:     "mouse,up,1";
  296.           source:     "p1";
  297.           action:     STATE_SET "default" 0.0;
  298.           transition: LINEAR 0.0;
  299.           target:     "p1";
  300.            }
  301.  */
  302.       }
  303.      }
  304. /*   
  305.    group
  306.      {
  307.     name: "test2";
  308.     parts
  309.       {
  310.          part
  311.            {
  312.           name: "p1";
  313.            }
  314.       }
  315.     programs
  316.       {
  317.       }
  318.      }
  319.  */
  320. }
  321.